<template>
	<div id='leftSide'>
		<Sider style= "position: fixed;width: 110px;min-width: 110px;max-width: 110px; height:100%;left: 90px;overflow:auto;">
            <Menu theme="light" :active-name="activeMenu" style="width: 110px;height: 100%;">
			        <MenuGroup title="商品管理" class='item-title'>
			        	<div class="hh" >
			        	  <MenuItem name="1"  @click.native="routeURl('/goods/library/libcontent')">
			                <span >商品库</span>  
			              </MenuItem>
			        	</div>
			            <div >
			            <MenuItem name="2" @click.native="routeURl('/goods/chuku')">
							<span>商品信息</span>
			            </MenuItem>
			            </div>
			            <MenuItem name="3" @click.native="routeURl('/goods/storesGoods')">
			                 <span>门店商品</span> 
			            </MenuItem>
			            <MenuItem name="4" @click.native="routeURl('/goods/onlineStore')">
			                <span>网店商品</span>             
			            </MenuItem>
			        </MenuGroup>
			        <MenuGroup title="存库" class='item-title'>
			            <MenuItem name="5" @click.native="routeURl('/goods/inventoryQuery')">
			                <span>存库查询</span>              
			            </MenuItem>
			            <MenuItem name="6" @click.native="routeURl('/goods/procurementOrder')">
			                <span>采购订单</span>             
			            </MenuItem>
			            <MenuItem name="7" @click.native="routeURl('/goods/goodsInlib')">
			                 <span>商品入库</span>            
			            </MenuItem>
			            <MenuItem name="8" @click.native="routeURl('/goods/goodsOutlib')">
			                <span>商品出库</span>              
			            </MenuItem>
			        </MenuGroup>
			      </Menu>
        </Sider>
                  
               <router-view></router-view> 
	</div>
	
</template>

<script>
	
	export default{
		name:'leftSide',
		data(){
			return{
				activeMenu:true,
			}
		},
		mounted(){
           this.menuList()
		},
		methods:{
			routeURl(url){
                this.$router.push({ path: url })
			},
			menuList(){  
             let path = this.$route.path  
             if(path.indexOf('/libcontent') != -1){  
                this.activeMenu = '1'
                return this.activeMenu
              }
              if(path.indexOf('/goods/chuku') != -1){
                  this.activeMenu = '2'
                  return this.activeMenu
              }
              if(path.indexOf('/storesGoods') != -1){
                  this.activeMenu = '3'
                  return this.activeMenu
              }
              if(path.indexOf('/onlineStore') != -1){
                  this.activeMenu = '4'
                  return this.activeMenu
			  }
			  if(path.indexOf('/inventoryQuery') != -1){
                  this.activeMenu = '5'
                  return this.activeMenu
			  }
			  if(path.indexOf('/procurementOrder') != -1){
                  this.activeMenu = '6'
                  return this.activeMenu
			  }
			  if(path.indexOf('/goodsInlib') != -1){
                  this.activeMenu = '7'
                  return this.activeMenu
			  }
			  if(path.indexOf('/goodsOutlib') != -1){
                  this.activeMenu = '8'
                  return this.activeMenu
              }
              
         }
		},
		
	}
</script>

<style>
	    .item-title{
    	text-align: left;
    }
</style>